Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of overcoming video broadcasting method in the problems referred to above or a kind of application program of solving the problem at least in part and device.
According to one aspect of the present invention, provide the video broadcasting method in a kind of application program, described method comprises:
When the broadcast event of the current video page in application program tackled by script, search the video source address in the described current video page, wherein, described script is be infused in advance in described application program for tackling the script of the broadcast event of the described current video page;
When finding the video source address in the described current video page, adopt the video that the player plays be embedded in described application program is corresponding to described video source address.
Alternatively, described in search video source address in the described current video page, comprise further:
The video source address in described video page is searched by the video playback request of simulating the page.
Alternatively, described when the broadcast event of the current video page in application program tackled by script, before searching the video source address in the described current video page, also comprise:
Judge whether the current page in described application program exists video to be played;
When current page exists video to be played, using described current page as the current video page.
Alternatively, whether the described current page judged in described application program exists video to be played, comprises further:
Video to be played whether is there is according to the current page that page logic judges in described application program.
Alternatively, the described current page judged in described application program also comprises before whether there is video to be played:
Receive the search word of user's input, search the info web relevant to described search word according to described search word, and the info web found is showed in the display interface of described application program;
Receive the touch command that user inputs in the display interface of described application program, determine the current page corresponding to described touch command according to described touch command, and in described application program, load the current page determined.
Alternatively, described employing is embedded in player plays in the described application program video corresponding to described video source address, comprises further:
The player be embedded in described application program is adopted to play the video corresponding to described video source address with full frame form.
Alternatively, described method also comprises:
When not finding the video source address in the described current video page, by the primary player plays video of system.
Alternatively, the described player primary by system carries out video playback, comprises further:
By the primary player of system with full frame form displaying video, and replace the broadcast interface of the primary player of described system by presetting interface.
According to another aspect of the present invention, provide the video play device in a kind of application program, described device comprises:
Unit is searched in loading, when being suitable for the broadcast event of the current video page in script interception application program, search the video source address in the described current video page, wherein, described script is be infused in advance in described application program for tackling the script of the broadcast event of the described current video page;
Video playback unit, is suitable for when finding the video source address in the described current video page, adopts the video that the player plays be embedded in described application program is corresponding to described video source address.
Alternatively, unit is searched in described loading, and the video source address in described video page is searched in the video playback request be further adapted for by simulating the page.
Alternatively, described device also comprises:
Page judging unit, is suitable for judging whether the current page in described application program exists video to be played; When current page exists video to be played, using described current page as the current video page.
Alternatively, described page judging unit, is further adapted for the current page judged in described application program according to page logic and whether there is video to be played.
Alternatively, described device also comprises:
Unit is searched in input, is suitable for the search word receiving user's input, searches the info web relevant to described search word, and be showed in by the info web found in the display interface of described application program according to described search word;
Touch-control receiving element, is suitable for the touch command that reception user inputs in the display interface of described application program, determines the current page corresponding to described touch command, and in described application program, load the current page determined according to described touch command.
Alternatively, described video playback unit, is further adapted for and adopts the player be embedded in described application program to play the video corresponding to described video source address with full frame form.
Alternatively, described video playback unit, is further adapted for when not finding the video source address in the described current video page, by the primary player plays video of system.
Alternatively, described video playback unit, is further adapted for by the primary player of system with full frame form displaying video, and replaces the broadcast interface of the primary player of described system by presetting interface.
The present invention first tackles the broadcast event of the described current video page by script, search the video source address in the described current video page again, if find the video source address in the described current video page, then adopt the video that the player plays be embedded in described application program is corresponding to described video source address, thus ensure that the result of broadcast of video playback is unified.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples for illustration of the present invention, but are not used for limiting the scope of the invention.
Fig. 1 is the flow chart of the video broadcasting method in the application program of one embodiment of the present invention; With reference to Fig. 1, described method comprises:
S101: when the broadcast event of the current video page in application program tackled by script, search the video source address in the described current video page, wherein, described script is be infused in advance in described application program for tackling the script of the broadcast event of the described current video page;
It should be noted that, when searching the video source address in the described current video page, various ways can be adopted, in order to improve search efficiency, in present embodiment, searched the video source address in described video page by the video playback request of simulating the page, the i.e. video playback request that sends when needing displaying video of the analog video page, certainly, other modes also can be adopted to search the video source address in the described current video page, and present embodiment is not limited this.
S102: when finding the video source address in the described current video page, adopts the video that the player plays be embedded in described application program is corresponding to described video source address.
Will be understood that, video is watched in order to user can be convenient to, in present embodiment, during the video adopting the player plays be embedded in described application program corresponding to described video source address, the video corresponding to described video source address can be play with full frame form.
Present embodiment first tackles the broadcast event of the described current video page by script, search the video source address in the described current video page again, if find the video source address in the described current video page, then adopt the video that the player plays be embedded in described application program is corresponding to described video source address, thus ensure that the result of broadcast of video playback is unified.
Fig. 2 is the flow chart of the video broadcasting method in the application program of one embodiment of the present invention; With reference to Fig. 2, described method comprises:
S200: judge whether the current page in described application program exists video to be played, when current page exists video to be played, using described current page as the current video page;
In specific implementation, when judging whether there is video to be played in the page, various ways can be adopted, for the ease of judging, in present embodiment, judge whether there is video to be played in the page according to page logic, because the page adopts the language compilation such as HTML usually, when loading displaying, by analyzing language such as its HTML, thus determine whether there is video to be played in this page.
It should be noted that, in order to meet the search need of user, and be convenient to user and determine current page, in present embodiment, before step S200, described method also comprises:
Receive the search word of user's input, search the info web relevant to described search word according to described search word, and the info web found is showed in the display interface of described application program;
Receive the touch command that user inputs in the display interface of described application program, determine the current page corresponding to described touch command according to described touch command, and in described application program, load the current page determined.
In specific implementation, in order to obtain video source address rapidly, first can set up and crack pool of page in advance, describedly crack in pool of page the corresponding relation having between video page and video source address in advance (the described video page cracked in advance in pool of page represents by its uniform resource position mark URL, certainly, also represent by features such as video name, present embodiment is without restriction to this), and temporarily in described application program, do not load current page, directly judge whether described current page exists video to be played, if exist in current page, then judge whether current page belongs to and crack pool of page in advance, if current page does not belong to crack pool of page in advance, in described application program, then load the current page determined, and perform step S200,
If current page belongs to crack pool of page in advance, then directly adopt the video that the player plays be embedded in described application program is corresponding to described video source address.
Under normal conditions, the point of interest of user is video itself, and the current video page is lost interest in, and the displaying of current page also needs to carry out transcoding process, need the longer response time, make Consumer's Experience poor, for avoiding occurring this problem, in present embodiment, determine the described current video page belong to described crack pool of page in advance time, direct employing is embedded in player plays in the described application program video corresponding to described video source address, can not show the described current video page again, further increasing Consumer's Experience.
Certainly, if when directly adopting the player plays be embedded in the described application program video corresponding to described video source address to occur playing unsuccessfully, may be there is mistake due to the video source address cracked in advance in pool of page, now, also in described application program, load the current page determined, and perform step S200.
In specific implementation, set up the process cracking pool of page in advance can comprise: obtain some video pages, search the video source address in described video page, the corresponding relation between described video page and the video source address found is stored to and describedly cracks pool of page in advance;
It should be noted that, be also the video source address of being searched by the video playback request of the simulation page in described video page in present embodiment.
Will be understood that, some video pages can be obtained as required, but because the amount of representing of this video page is too low, even if be stored to described cracking in advance in pool of page, also can lessly use in follow-up deterministic process, also can waste certain memory space simultaneously, for avoiding occurring this problem, in present embodiment, when obtaining some video pages, first capture some pages, and obtain the amount of representing of each page, when the amount of representing exceedes predetermined threshold value, judge whether there is video to be played in this page again, and will the page of video to be played be there is as video page.
In addition, because the described video source address cracked in advance in pool of page changes possibly, if after foundation cracks pool of page in advance, do not upgrade always, then easily occur video source address failure, cause video playback failure, in order to avoid this problem, in present embodiment, after step S200, also comprise: often through prefixed time interval, the described pool of page that cracks in advance is upgraded.
Will be understood that, user inputs touch command in the display interface of described application program can adopt various ways, comes the touch point on touch-control mobile terminal screen, certainly as by user's finger or induction pen, also can adopt other modes, present embodiment is not limited this.
S201: when the broadcast event of the current video page in application program tackled by script, search the video source address in the described current video page, wherein, described script is be infused in advance in described application program for tackling the script of the broadcast event of the described current video page;
S202: when finding the video source address in the described current video page, adopts the video that the player plays be embedded in described application program is corresponding to described video source address.
Step S101 ~ the S102 of the execution mode shown in step S201 ~ S202 and Fig. 1 is identical, does not repeat them here.
During in order to ensure not find the video source address in the described current video page, also can ensure that the result of broadcast of video playback is unified, in present embodiment, if do not find the video source address in the described current video page, then by the primary player of system (such as: webview player primary in Android system) displaying video.
Because the primary player of system can ensure the Objective of broadcasting, can ensure in the ordinary course of things only to play corresponding video, and break for commercialsy not before broadcasting or in playing, further increasing Consumer's Experience.
In addition, in order to ensure that user is consistent with the sensation by being embedded in the player in described application program by sensation during system primary player viewing video, in present embodiment, when the player primary by system carries out video playback, by the primary player of system with full frame form displaying video, and replace the broadcast interface of the primary player of described system by presetting interface.
For embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the embodiment of the present invention is not by the restriction of described sequence of movement, because according to the embodiment of the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in specification all belongs to preferred embodiment, and involved action might not be that the embodiment of the present invention is necessary.
Fig. 3 is the structured flowchart of the video play device in the application program of one embodiment of the present invention; With reference to Fig. 3, described device comprises:
Unit 301 is searched in loading, when being suitable for the broadcast event of the current video page in script interception application program, search the video source address in the described current video page, wherein, described script is be infused in advance in described application program for tackling the script of the broadcast event of the described current video page;
Video playback unit 302, is suitable for when finding the video source address in the described current video page, adopts the video that the player plays be embedded in described application program is corresponding to described video source address.
In a kind of embodiment of the present invention, unit is searched in described loading, and the video source address in described video page is searched in the video playback request be further adapted for by simulating the page.
Fig. 4 is the structured flowchart of the video play device in the application program of one embodiment of the present invention; With reference to Fig. 4, described device comprises:
Page judging unit 400, is suitable for judging whether the current page in described application program exists video to be played; When current page exists video to be played, using described current page as the current video page;
Unit 401 is searched in loading, when being suitable for the broadcast event of the current video page in script interception application program, search the video source address in the described current video page, wherein, described script is be infused in advance in described application program for tackling the script of the broadcast event of the described current video page;
Video playback unit 402, is suitable for when finding the video source address in the described current video page, adopts the video that the player plays be embedded in described application program is corresponding to described video source address.
In a kind of embodiment of the present invention, described page judging unit, is further adapted for the current page judged in described application program according to page logic and whether there is video to be played.
In a kind of embodiment of the present invention, described device also comprises:
Unit is searched in input, is suitable for the search word receiving user's input, searches the info web relevant to described search word, and be showed in by the info web found in the display interface of described application program according to described search word;
Touch-control receiving element, is suitable for the touch command that reception user inputs in the display interface of described application program, determines the current page corresponding to described touch command, and in described application program, load the current page determined according to described touch command.
In a kind of embodiment of the present invention, described video playback unit, is further adapted for and adopts the player be embedded in described application program to play the video corresponding to described video source address with full frame form.
In a kind of embodiment of the present invention, described video playback unit, is further adapted for when not finding the video source address in the described current video page, by the primary player plays video of system.
In a kind of embodiment of the present invention, described video playback unit, is further adapted for by the primary player of system with full frame form displaying video, and replaces the broadcast interface of the primary player of described system by presetting interface.
For system embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Should be noted that, in all parts of system of the present invention, the function that will realize according to it and logical partitioning has been carried out to parts wherein, but, the present invention is not limited to this, can repartition all parts as required or combine, such as, can be single parts by some component combinations, or some parts can be decomposed into more subassembly further.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the system of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computer of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
Above execution mode is only suitable for the present invention is described; and be not limitation of the present invention; the those of ordinary skill of relevant technical field; without departing from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all equivalent technical schemes also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.
The invention discloses the video broadcasting method in A1, a kind of application program, described method comprises:
When the broadcast event of the current video page in application program tackled by script, search the video source address in the described current video page, wherein, described script is be infused in advance in described application program for tackling the script of the broadcast event of the described current video page;
When finding the video source address in the described current video page, adopt the video that the player plays be embedded in described application program is corresponding to described video source address.
A2, method as described in claim A1, described in search video source address in the described current video page, comprise further:
The video source address in described video page is searched by the video playback request of simulating the page.
A3, method according to any one of claim A1-A2, during the broadcast event of the described current video page in script interception application program, before searching the video source address in the described current video page, also comprise:
Judge whether the current page in described application program exists video to be played;
When current page exists video to be played, using described current page as the current video page.
A4, method according to any one of claim A1-A3, whether the described current page judged in described application program exists video to be played, comprises further:
Video to be played whether is there is according to the current page that page logic judges in described application program.
A5, method according to any one of claim A1-A4, the described current page judged in described application program also comprises before whether there is video to be played:
Receive the search word of user's input, search the info web relevant to described search word according to described search word, and the info web found is showed in the display interface of described application program;
Receive the touch command that user inputs in the display interface of described application program, determine the current page corresponding to described touch command according to described touch command, and in described application program, load the current page determined.
A6, method according to any one of claim A1-A5, described employing is embedded in player plays in the described application program video corresponding to described video source address, comprises further:
The player be embedded in described application program is adopted to play the video corresponding to described video source address with full frame form.
A7, method according to any one of claim A1-A6, described method also comprises:
When not finding the video source address in the described current video page, by the primary player plays video of system.
A8, method according to any one of claim A1-A7, the described player primary by system carries out video playback, comprises further:
By the primary player of system with full frame form displaying video, and replace the broadcast interface of the primary player of described system by presetting interface.
The invention also discloses the video play device in B9, a kind of application program, described device comprises:
Unit is searched in loading, when being suitable for the broadcast event of the current video page in script interception application program, search the video source address in the described current video page, wherein, described script is be infused in advance in described application program for tackling the script of the broadcast event of the described current video page;
Video playback unit, is suitable for when finding the video source address in the described current video page, adopts the video that the player plays be embedded in described application program is corresponding to described video source address.
B10, device as described in claim B9, unit is searched in described loading, and the video source address in described video page is searched in the video playback request be further adapted for by simulating the page.
B11, device according to any one of claim B9-B10, described device also comprises:
Page judging unit, is suitable for judging whether the current page in described application program exists video to be played; When current page exists video to be played, using described current page as the current video page.
B12, device according to any one of claim B9-B11, described page judging unit, is further adapted for the current page judged in described application program according to page logic and whether there is video to be played.
B13, device according to any one of claim B9-B12, described device also comprises:
Unit is searched in input, is suitable for the search word receiving user's input, searches the info web relevant to described search word, and be showed in by the info web found in the display interface of described application program according to described search word;
Touch-control receiving element, is suitable for the touch command that reception user inputs in the display interface of described application program, determines the current page corresponding to described touch command, and in described application program, load the current page determined according to described touch command.
B14, device according to any one of claim B9-B13, described video playback unit, is further adapted for and adopts the player be embedded in described application program to play the video corresponding to described video source address with full frame form.
B15, device according to any one of claim B9-B14, described video playback unit, is further adapted for when not finding the video source address in the described current video page, by the primary player plays video of system.
B16, device according to any one of claim B9-B15, described video playback unit, is further adapted for by the primary player of system with full frame form displaying video, and replaces the broadcast interface of the primary player of described system by presetting interface.